import useRequest from "./request";
//用户注册登录--使用钱包
export async function signupByWallet(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/user/signup_by_wallet",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}

//用户名注册登录--使用钱包
export async function signinByWallet(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/user/signin_by_wallet",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}

//用户名注册登录--使用钱包
export async function userSignRandom(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/user/sign_random",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}


//用户登出
export async function signout(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/user/signout",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}


//获取游戏列表
export async function gameList(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/tc/game_list",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}


//天成平台余额
export async function getBalance(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/tc/get_balance",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}


//启动游戏
export async function launchGame(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/tc/launch_game",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}



//转入/转出 - 积分 <==> 平台
export async function fundTransfer(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/tc/fund_transfer",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}

/**
 * 获取充值钱包
 * @param data 
 * @returns 
 */
export async function czRechargeGetChargeWallet(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/cz/recharge/get_charge_wallet",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}

/**
 * 统计：我的余额、累计参与量、累计收益
 * @param data 
 * @returns 
 */
export async function meGetAssetsInfo(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/me/get_assets_info",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}

/**
 * 充值记录
 * @param data 
 * @returns 
 */
export async function czRechargeChargeList(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/cz/recharge/charge_list",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}


/**
 * 我的投注
 * @param data 
 * @returns 
 */
export async function meMyPlayList(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/me/my_play_list",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}

/**
 * 玩家排行榜
 * @param data 
 * @returns 
 */
export async function tcPlayerRankList(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/tc/player_rank_list",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}

/**
 * 提现
 * @param data 
 * @returns 
 */
export async function czWithdrawWithdraw(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/cz/withdraw/withdraw",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}

/**
 * 提现记录
 * @param data 
 * @returns 
 */
export async function withdrawList(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/cz/withdraw/list",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}

/**
 * 绑定邮箱
 * @param data 
 * @returns 
 */
export async function bindEmail(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/user/bind_email",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}


/**
 * 提现获取邮箱验证码
 * @param data 
 * @returns 
 */
export async function sysMailCaptchaForWithdraw(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/sys/mail/captcha_for_withdraw",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}

/**
 * 绑定邮箱获取邮箱验证码
 * @param data 
 * @returns 
 */
export async function sysMailCaptchaForBindMail(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/sys/mail/captcha_for_bind_mail",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}



/**
 * 我的团队列表
 * @param data 
 * @returns 
 */
export async function meMyInvitList(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/me/my_invit_list",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}



/**
 * Banner List
 * @param data 
 * @returns 
 */
export async function publicBannerList(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/public/banner/list",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}


/**
 * Banner List
 * @param data 
 * @returns 
 */
export async function publicNoticeList(data: any) {
  let { response, request } = useRequest<{
    code: number;
    result: string;
  }>(
    "/public/notice/list",
    {
      method: "post",
      data
    }
  );
  await request();
  return response;
}

